package com.arofoxmsn.repository;

import org.hibernate.cfg.AnnotationConfiguration;
import org.hibernate.tool.hbm2ddl.SchemaExport;

import com.arofoxmsn.model.Picture;
import com.arofoxmsn.model.User;
import com.arofoxmsn.model.comunication.AbstractComunicationMedia;
import com.arofoxmsn.model.comunication.Mail;
import com.arofoxmsn.model.comunication.Messenger;
import com.arofoxmsn.model.comunication.MobilePhone;
import com.arofoxmsn.model.comunication.Phone;
import com.arofoxmsn.model.comunication.SocialNetwork;
import com.arofoxmsn.model.friendship.Friendship;
import com.arofoxmsn.model.friendship.FriendshipConfiguration;
import com.arofoxmsn.model.identifiedObject.FavoriteObject;
import com.arofoxmsn.model.identifiedObject.MyObject;
import com.arofoxmsn.model.invitation.AbstractInvitation;
import com.arofoxmsn.model.invitation.FriendsipInvitation;
import com.arofoxmsn.model.invitation.InvitationStateType;
import com.arofoxmsn.model.location.FavoriteLocation;
import com.arofoxmsn.model.location.UserLocation;
import com.arofoxmsn.model.message.Conversation;
import com.arofoxmsn.model.message.Message;
import com.arofoxmsn.model.profile.PersonalData;
import com.arofoxmsn.model.profile.Profile;
import com.arofoxmsn.model.profile.RelationshipStatus;
import com.arofoxmsn.model.profile.Sex;
import com.arofoxmsn.model.publication.AbstractComment;
import com.arofoxmsn.model.publication.AbstractPublication;
import com.arofoxmsn.model.publication.News;
import com.arofoxmsn.model.publication.NewsComment;
import com.arofoxmsn.model.publication.PicturePublication;
import com.arofoxmsn.model.publication.ThirdPartPublication;
import com.arofoxmsn.model.userstate.AbstractUserState;
import com.arofoxmsn.model.userstate.AvaibleUserState;
import com.arofoxmsn.model.userstate.BusyUserState;
import com.arofoxmsn.model.userstate.InvisibleUserState;

public class MyHibernateConfig {
	
	private static Class[] classesToCreate = {
		UserLocation.class,
		Picture.class,
		AbstractUserState.class,
		User.class,
		AbstractComunicationMedia.class,
		Mail.class,
		Messenger.class,
		MobilePhone.class,
		Phone.class,
		SocialNetwork.class,
		Friendship.class,
		FriendshipConfiguration.class,
		FavoriteObject.class,
		MyObject.class,
		AbstractInvitation.class,
		FriendsipInvitation.class,
		InvitationStateType.class,
		FavoriteLocation.class,
		UserLocation.class,
		Conversation.class,
		Message.class,
		PersonalData.class,
		Profile.class,
		RelationshipStatus.class,
		Sex.class,
		AbstractComment.class,
		AbstractPublication.class,
		News.class,
		NewsComment.class,
		PicturePublication.class,
		ThirdPartPublication.class,
		AvaibleUserState.class,
		AbstractUserState.class,
		BusyUserState.class,
		InvisibleUserState.class
	};
	
	public static void init(){
		AnnotationConfiguration config = new AnnotationConfiguration();
		for(Class oneClass : classesToCreate){
			config.addAnnotatedClass(oneClass);
		}
		config.configure();
//		new SchemaExport(config).create(true, true);
	}
}
